import pylab as p
fig = p.figure()
ax1 = fig.add_subplot(111)
ax2 = ax2 = ax1.twinx()


x = [1,2,3]
y = [4,6,3]

# first axis, with the same bar plot as before.
ax1.bar(x,y)

# on the second axis, make the width smaller (default is 0.8)
ax2.plot(x,y,'r-')
ax2.set_ylabel('number of widgets')

p.show()